home *** CD-ROM | disk | FTP | other *** search
/ Dynamic HTML Construction Kit / Dynamic HTML Construction Kit.iso / source_code / dhtmlunl / dhtml.exe / CD Content / Chap28 / dun28_6.txt < prev   
Encoding:
Text File  |  1997-12-18  |  615 b   |  22 lines

  1. function audioEnabled(plug_in) {
  2.  
  3.     for (var i = 0; i < navigator.plugins.length; i++) {
  4.  
  5.         if (navigator.plugins[i].name.toLowerCase() == plug_in.toLowerCase()) {
  6.  
  7.             for (var j = 0; j < navigator.plugins[i].length; j++) {
  8.  
  9.                 if (navigator.plugins[i][j].enabledPlugin) {
  10.  
  11.                     return true
  12.  
  13.                 }
  14.  
  15.             }
  16.  
  17.             return false
  18.  
  19.         }
  20.  
  21.     }
  22.  
  23.     return false
  24.  
  25. }
  26.  
  27.  
  28.  
  29. function playAudio(cmd) {
  30.  
  31.     if (audioEnabled("LiveAudio")) {
  32.  
  33.         if (cmd == "2001") {
  34.  
  35.             document.MIDI.play(false);
  36.  
  37.         }
  38.  
  39.     }
  40.  
  41. }
  42.  
  43.